Java NIO: How to Always Overwrite an Existing File Because sometimes the destructive path is the only path.
Java NIO: Tighten Your Code With the deleteIfExists() method Don't write any more lines of code than you need to.
Java NIO: How to Avoid Overwriting an Existing File When Creating a New File Protect your file with a single enum.